package com.Android.Intr;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;

public class EventViewActivity extends Activity{

	TextView titleText;
	TextView dateText;
	TextView timeText;
	TextView locationText;
	TextView detailText;
	Button backButton;
	
	public void onCreate(Bundle savedInstanceState) {
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.eventviewer);	
        
        final Intent myIntent = getIntent(); // this is just for example purpose
        myIntent.getStringExtra("key");
        
        titleText = (TextView) findViewById(R.id.eventViewerTitle);
        titleText.setText(myIntent.getStringExtra("title"));
        
        dateText = (TextView) findViewById(R.id.eventViewerDate);
        dateText.setText(myIntent.getStringExtra("startDate"));
        
        timeText = (TextView) findViewById(R.id.eventViewerTime);
        timeText.setText(myIntent.getStringExtra("startTime"));
        
        locationText = (TextView) findViewById(R.id.eventViewerLocation);
        locationText.setText(myIntent.getStringExtra("location"));
        
        detailText = (TextView) findViewById(R.id.eventViewerDetail);
        detailText.setText(myIntent.getStringExtra("description"));
        
        ImageButton ib = (ImageButton) findViewById(R.id.eventViewerImageButton);
        ib.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent toMyMapView = new Intent(EventViewActivity.this, MyMapView.class);
				toMyMapView.putExtra("lon", myIntent.getStringExtra("lon"));
				toMyMapView.putExtra("lat", myIntent.getStringExtra("lat"));
				toMyMapView.putExtra("location", myIntent.getStringExtra("location"));
				toMyMapView.putExtra("title", myIntent.getStringExtra("title"));
				toMyMapView.putExtra("date", myIntent.getStringExtra("date"));
				toMyMapView.putExtra("time", myIntent.getStringExtra("time"));
				toMyMapView.putExtra("detail", myIntent.getStringExtra("detail"));
				startActivity(toMyMapView);
			}
		});
        
        
		
	}
}
	

